//
//  MCUserDefinedLotteryCategoriesHeaderView.m
//  TLYL
//
//  Created by MC on 2017/6/19.
//  Copyright © 2017年 TLYL01. All rights reserved.
//

#import "MCUserDefinedLotteryCategoriesHeaderView.h"
@interface MCUserDefinedLotteryCategoriesHeaderView ()

@property (nonatomic,strong)UILabel * lab_title;

@property (nonatomic,strong)UIView  * view_line;
@end

@implementation MCUserDefinedLotteryCategoriesHeaderView
#pragma mark - Init
- (instancetype)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame]) {
        
        [self setUpUI];
    }
    return self;
}


- (void)setUpUI{
    
    _lab_title =[[UILabel alloc]init];
    _lab_title.textColor=RGB(165, 165, 165);
    _lab_title.font=[UIFont systemFontOfSize:15];
    _lab_title.text =@"加载中";
    _lab_title.textAlignment=NSTextAlignmentLeft;
    [self  addSubview:_lab_title];
    
    /*
     * 画线
     */
    _view_line=[[UIView alloc]init];
    _view_line.backgroundColor=RGB(229, 229, 229);
    [self addSubview:_view_line];
    
    [self layOutConstraints];
    
}

-(void)layOutConstraints{
    
    [_lab_title mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.mas_top).offset(10);
        make.right.equalTo(self.mas_right).offset(-10);
        make.left.equalTo(self.mas_left).offset(10);
        make.height.mas_equalTo(20);
        
    }];
    
    /*
     * 画线
     */
    [_view_line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(0);
        make.right.equalTo(self.mas_right).offset(0);
        make.height.mas_equalTo(1.0);
        make.bottom.equalTo(self.mas_bottom);
    }];
    
}

+(CGFloat)computeHeight:(id)info{
    return 30;
}

-(void)setDataSource:(id)dataSource{
    _dataSource=dataSource;
    _lab_title.text = dataSource;
}

    

/*
 // Only override drawRect: if you perform custom drawing.
 // An empty implementation adversely affects performance during animation.
 - (void)drawRect:(CGRect)rect {
 // Drawing code
 }
 */

@end
